package com.itheima.Demo;

import com.itheima.proxy.UserServiceCglibProxy;
import com.itheima.proxy.UserServiceJDKProxy;
import com.itheima.service.UserService;
import com.itheima.service.impl.UserServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo1 {
    @Test
    public void test01(){
        UserService userService = new UserServiceImpl();
        UserService jdkProxy = UserServiceJDKProxy.createJDKProxy(userService);
        jdkProxy.save();
    }
    @Test
    public void test02(){
        UserService cglibProxy = UserServiceCglibProxy.createCglibProxy(UserServiceImpl.class);
        cglibProxy.save();
    }
}
